package cn.gson.boot.model.dao;

import cn.gson.boot.model.pojos.Tuihuo;
import cn.gson.boot.model.pojos.Tuihuoxiangqing;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;

import javax.transaction.Transactional;

public interface TuiHuoXiangQinDao extends CrudRepository<Tuihuoxiangqing,Integer> {
    //修改后台时会重复新增退货详情，所以先根据退货id删除一下
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "delete from tuihuoxiangqing where th_id = ?1")
    public void deleteTuiHuoXiangQing(Integer thId);
    /*//根据合同id来移除合同 （逻辑删除）
    @Transactional
    @Modifying(clearAutomatically = true)
    @Query(nativeQuery = true,value = "update hetong set ht_ys=0 where ht_id=?1")
    public void yichuHeTong(Integer htid);*/

}
